#include "head.h"

int epoll_pool_add(int fd, int epoll_fd)
{
    struct epoll_event event;
    event.events = EPOLLIN;
    event.data.fd = fd;
    if(epoll_ctl(epoll_fd, EPOLL_CTL_ADD, fd, &event) == -1)
        error(1, errno, "epoll_ctl");
    return 0;
}

int epoll_pool_del(int fd, int epoll_fd)
{
    if(epoll_ctl(epoll_fd, EPOLL_CTL_DEL, fd, NULL) == -1)
        error(1, errno, "epoll_ctl");

    return 0;
}
